package juc.java8;
@FunctionalInterface
public interface Converter<F, T> {
     T convert(F from);

    public static void main(String[] args) {
//        Converter<String, Integer> converter = (aa) -> Integer.valueOf(aa);
//        Integer converted = converter.convert("123");
//        System.out.println(converted.getClass()); //class java.lang.Integer


        Converter<String, Integer> converter = new Converter<String, Integer>() {
            @Override
            public Integer convert(String from) {
                return 2;
            }
        };

        Converter<String, Integer> converter1 = Integer::valueOf;
        Integer aaa = converter1.convert("aaa");

    }
}
class Person {
    String firstName;
    String lastName;

    Person() {}

    Person(String firstName, String lastName) {
        this.firstName = firstName;
        this.lastName = lastName;
    }
}

class Stu {
    Integer id;
    String name;
    Integer age;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Stu(Integer id, String name, Integer age) {
        this.id = id;
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Stu{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}